import React, { Component } from 'react'
import {
  StyleSheet,
  View,
  Text,
} from 'react-native'
import NavigatorUtil from './js/utils/NavigatorUtil'
import NavigationBar from './js/common/NavigationBar'
class Boy extends Component {
  constructor(props) {
    super(props)
    this.params = this.props.navigation.state.params
    this.state = {
      word: ''
    }
  }
  render() {
    return (
      <View style={styles.container}>
        <NavigationBar
          title={'boy'}
          statusBar={{
            backgroundColor: '#64B5F6'
          }}
        />
        <Text style={styles.text}>I am Boy</Text>
        <Text
          style={styles.text}
          onPress={() => {
            NavigatorUtil.goToGirl({
              navigation: this.props.navigation,
              word: '一枝玫瑰',
              success: (word) => {
                this.setState({
                  word: word
                })
              },
            })
          }}
        >
          送女孩一朵玫瑰
                </Text>
        <Text style={styles.text}>接受到：{this.state.word}</Text>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'gray',
    // justifyContent: 'center'
  },
  text: {
    fontSize: 20,
  }
})

export default Boy
